package hell.satan.droidbdf.survey;

import android.app.Activity;
import android.content.Context;

import java.util.Map;

/**
 * 每一个数据上报都需要实现此接口。
 * Each statistics should implement this interface.
 *
 * @author Cerberus
 */
@SuppressWarnings("unused")
public interface ISurvey {
    /**
     * 上报Activity的onResume事件
     * Reported onResume events of an activity
     *
     * @param activity 触发onResume事件的Activity
     *                 Activity of who triggered OnResume event
     */
    void onResume(Activity activity);

    /**
     * 上报Activity的onPause事件
     * Reported onPause events of an activity
     *
     * @param activity 触发onPause事件的Activity
     *                 Activity of who triggered onPause event
     */
    void onPause(Activity activity);

    /**
     * 上报一个无附加数据的普通事件
     * Reported an ordinary event without additional data
     *
     * @param event 事件名称
     *              Name of event
     */
    void onEvent(Context context, String event);

    /**
     * 上报一个有简单数据的普通事件
     * Reported an ordinary event with simple data
     *
     * @param event 事件名称
     *              Name of event
     * @param value 附加简单数据
     *              Additional simple data
     */
    void onEvent(Context context, String event, String value);

    /**
     * 上报一个有复杂附加数据的普通事件
     * Reported an ordinary event with complex data
     *
     * @param event  事件名称
     *               Name of event
     * @param extras 附加复杂数据
     *               Additional complex data
     */
    void onEvent(Context context, String event, Map<String, String> extras);

    /**
     * 上报一个事件的开始
     * Reported the beginning of an event
     *
     * @param event 事件名称
     *              Name of event
     */
    void onEventBegin(Context context, String event);

    /**
     * 上报一个事件的结束
     * Reported the ending of an event
     *
     * @param event 事件名称
     *              Name of event
     */
    void onEventEnd(Context context, String event);
}
